local biyue = fk.CreateSkill({
  name = "mini_mou__biyue",
  tags = { Skill.Compulsory },
})

Fk:loadTranslationTable{
  ["mini_mou__biyue"] = "闭月",
  [":mini_mou__biyue"] = "锁定技，结束阶段，你摸X张牌（X为本回合受到过伤害的角色数+1，至多为4）。",

  ["$mini_mou__biyue1"] = "娇容胜月，柔情似水。",
  ["$mini_mou__biyue2"] = "惊鸿之姿，闭月之貌。",
}

biyue:addEffect(fk.EventPhaseStart, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(biyue.name) and player.phase == Player.Finish
  end,
  on_use = function(self, event, target, player, data)
    local targets = {}
    player.room.logic:getActualDamageEvents(1, function(e)
      table.insertIfNeed(targets, e.data.to.id)
    end, Player.HistoryTurn)
    player:drawCards(math.min(1 + #targets, 4), biyue.name)
  end,
})

return biyue
